import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';



Widget setTag(int type){
  Widget widget;
  if(type==0){
    widget=_XianHuoTag();
  }else if(type==1){
    widget=QiHuoTag();
  }else if(type==2){
    widget=_ShaoLiangXianHuoTag();
  }else{
    widget=SizedBox.fromSize(size: Size(0, 0),);
  }
   return widget;
}


//期货标签
class QiHuoTag extends StatefulWidget {
  @override
  _QiHuoTagState createState() => _QiHuoTagState();
}

class _QiHuoTagState extends State<QiHuoTag> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.fromLTRB(0, 0, 0, 1),
      margin: EdgeInsets.zero,
      alignment: Alignment.center,
      height: 20.h,
      width: 35.w,
      decoration: BoxDecoration(color: Color(0xffF3FAFF),borderRadius:BorderRadius.circular(4.r),
          border: Border.all(color: Color(0xff95D1FF),width: 0.5)
      ),
      child: Text("期货",style: TextStyle(color: Color(0xff4EB2FF), fontSize: 10.sp),textAlign: TextAlign.center),
    );
  }
}


//现货标签
class _XianHuoTag extends StatefulWidget {
  @override
  _XianHuoTagState createState() => _XianHuoTagState();
}

class _XianHuoTagState extends State<_XianHuoTag> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.fromLTRB(0, 0, 0, 1),
      margin: EdgeInsets.zero,
      alignment: Alignment.center,
      height: 20.h,
      width: 35.w,
      decoration: BoxDecoration(color: Color(0xffFFF2F5),borderRadius:BorderRadius.circular(4.r),
            border: Border.all(color: Color(0xffFF8EAA),width: 0.5)
      ),
      child: Text("现货",style: TextStyle(color: Color(0xffFF0242), fontSize: 10.sp),textAlign: TextAlign.center,),
    );
  }
}


//少量现货标签
class _ShaoLiangXianHuoTag extends StatefulWidget {
  @override
  _ShaoLiangXianHuoTagState createState() => _ShaoLiangXianHuoTagState();
}

class _ShaoLiangXianHuoTagState extends State<_ShaoLiangXianHuoTag> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.fromLTRB(0, 0, 0, 1),
      margin: EdgeInsets.zero,
      alignment: Alignment.center,
      height: 20.h,
      width: 55.w,
      decoration: BoxDecoration(color: Color(0xffFFF2F5),
          borderRadius:BorderRadius.circular(4.r),
          border: Border.all(color: Color(0xffFF8EAA),width: 0.5)
      ),
      child: Text("少量现货",style: TextStyle(color: Color(0xffFF0242), fontSize: 10.sp),textAlign: TextAlign.center),
    );
  }
}